package com.jiukuaidao.zhulin.api;

import com.jiukuaidao.library.Config;
import com.jiukuaidao.library.net.ApiCusParamAbstract;
import com.jiukuaidao.zhulin.util.RetrofitUtil;

import retrofit2.Call;

/**
 * Author : BinarySatan
 * Date : 2016/5/24
 * Description :
 */
public class ApiPoiSearch<T> extends ApiCusParamAbstract {


    public ApiPoiSearch(String query, String queryCity, retrofit2.Callback<T> callback) {
        super(callback);
        query = query.trim().replace(" ", "");
        mParams.put("output", "json");
        mParams.put("query", query);
        mParams.put("page_size", 20);
        mParams.put("page_num", 0);
        mParams.put("scope", 1);
        mParams.put("region", queryCity);
        mParams.put("ak", Config.KEY.BAIDU_SERVER_AK);
        mParams.put("city_limit", true);  //是否只返回指定region（城市）内的POI，true(是)，false（否）。


    }

    @Override
    public Call<T> getCall() {
        return RetrofitUtil.getApiManager("http://api.map.baidu.com/", null, null).poiSearch(mParams);
    }
}
